package com.caigou.modules.tools.adapter

import android.widget.FrameLayout
import com.caigou.comm.base.bean.AppBackgroundInfo
import com.caigou.modules.tools.R
import com.caigou.modules.tools.databinding.ItemInviteBannerBinding
import com.zhpan.bannerview.BaseBannerAdapter
import com.zhpan.bannerview.BaseViewHolder

/**
 * @author #Suyghur.
 * Created on 2021/10/27
 */
class InviteBannerAdapter : BaseBannerAdapter<Int>() {

    val views = mutableListOf<FrameLayout>()
    override fun bindData(holder: BaseViewHolder<Int>, data: Int, position: Int, pageSize: Int) {
        val binding = ItemInviteBannerBinding.bind(holder.itemView)
        binding.itemInviteFlContainer.setBackgroundResource(data)
        binding.itemInviteTvCode.text = AppBackgroundInfo.instance.userBean!!.ownInvitationCode
        views.add(binding.itemInviteFlContainer)
    }

    override fun getLayoutId(viewType: Int): Int {
        return R.layout.item_invite_banner
    }
}